<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let salaries = {
        John: 100,
        Ann: 160,
        Pete: 130,
      };

      function maxSalaries(obj) {
        let maxName = "";
        let maxNum = 0;
        for (const k in obj) {
          if (maxNum < obj[k]) {
            maxNum = obj[k];
            maxName = k;
          }
        }
        return maxName;
      }
      console.log(maxSalaries(salaries));
    </script>
  </body>
</html>
